#!/bin/bash

# This script generates cc code and compiles it as a library
# The script assumes that the file Main.m4 exists

numParallelJobs=20

# the two arguments
dirPath=$1
objects=$2


echo "Parameters: $1 $2"

cd $dirPath

echo "Compiling the code"

# just in case the compiler is the intel compiler
#source /opt/intel/Compiler/11.1/056/bin/iccvars.sh intel64

export OBJECTS="$objects"
make -k -f ./MK-generated -j ${numParallelJobs}
